package abstractFactory;

import abstractFactory.custom.Customer;
import abstractFactory.itf.ChinaKfcFactory;
import abstractFactory.itf.IKfcFactory;

/**
 * 抽象工厂模式
 *
 * @author laigl 2017年7月10日
 *
 */
public class AbstractFactoryClient {

	public static void main(String[] args) {
		// 店
		IKfcFactory kfcFactory = new ChinaKfcFactory();
		// 客户
		Customer customer = new Customer(kfcFactory);
		// 点餐
		float hamburgMoney = customer.orderHamburg(1);
		float chickenWingsMoney = customer.orderChickenWings(4);
		float frenchFriesMoney = customer.orderFrenchFries(1);
		float beverageMoney = customer.orderBeverage(2);
		System.out.println("总计：" + (hamburgMoney + chickenWingsMoney + frenchFriesMoney + beverageMoney));

	}

}
